﻿-- =============================================
-- Author:		<XFL>
-- Create date: <20111217>
-- Description:	<About wage more updateFinance >
-- =============================================
CREATE PROCEDURE [dbo].[proc_Wage_UpdateFinance_more] 
	-- Add the parameters for the stored procedure here
	@Id_str nvarchar(MAX),
	@userid VARCHAR(10),
	@username  nVARCHAR(20)
AS
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering ;WITH SELECT statements.

	--Update Employee_Wage Set FinanceFlag=2,FinanceFlagDate=GetDate() Where Id in (@Id_str)

EXEC('Update Employee_Wage Set FinanceFlag=2,FinanceFlagDate=GetDate() Where Id in ('+@Id_str+')







')

--Insert Into Finance_Outlay
--	(
--		CreateDate,
--		TradeDate,
--		Summary,
--		CateOneId,
--		CateOneName,
--		CateTwoId,
--		CateTwoName,
--		SubjectId,
--		SubjectName,
--		PaymentTypeId,
--		PaymentTypeName,
--		BankId,
--		BankName,
--		OutlayReason,
--		OutlayPrice,
--		Agent,
--		AgentName,
--		PZPerson,
--		PZPersonName,
--		SHPerson,
--		SHPersonName,
--		UserName,
--		EName,
--		Description,
--		BillNumber,
--		CompanyId,
--		CompanyIdCur,
--		DepartmentIdCur
--	)
--	SELECT 
--		GETDATE(),
--		Convert(varchar(10),GETDATE(),120),
--		[EName]+''工资'',
--		16,
--		''费用类'',
--		10,
--		''人力费用'',
--		187,
--		''人员工资'',
--		1,
--		''现金'',
--		1,
--		''现金'',
--		[EName]+''工资'',
--		ew.HeJiWage,
--		'''+@userid+''',
--		'''+@username+''',
--		'''',
--		'''',
--		'''',
--		'''',
--		'''+@userid+''',
--		'''+@username+''',
--		'''',
--		'''',
--		ew.CompanyId,
--		ew.CompanyId,
--		0
--	FROM Employee_Wage ew WHERE id in ('+@Id_str+')
